package com.holly.unit.deform.api.enums;

import cn.hutool.core.util.StrUtil;

/**
 * 类描述: 权限类型枚举类
 *
 * @author fxr
 * @version 1.0.0
 * @date 2022/4/2 8:11
 */
public enum PermissionTypeEnum {

    DATA("data", "数据权限"),
    BUTTON("button", "按钮权限"),
    FIELD("field", "字段权限");

    private String value;

    private String message;

    PermissionTypeEnum(String value, String message) {
        this.value = value;
        this.message = message;
    }

    public String getValue() {
        return value;
    }

    public String getMessage() {
        return message;
    }

    public static PermissionTypeEnum getByValue(String value) {
        if (StrUtil.isBlank(value)) {
            return null;
        }
        for (PermissionTypeEnum item : values()) {
            if (item.getValue().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

}
